package com.wss.day10.stream;

import java.util.function.BiFunction;

/**
 * @author wangshaoshuai
 * @desc TODO
 * @date 2025/5/7
 */
class Person {
    private String name;
    private int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    @Override
    public String toString() {
        return "Person{name='" + name + "', age=" + age + "}";
    }
}

public class BiFunctionExample {
    public static void main(String[] args) {
        BiFunction<String, Integer, Person> personCreator = Person::new;

        Person person = personCreator.apply("张三", 25);
        System.out.println(person);
    }
}
